# Contributor: Patrycja Rosa <alpine@ptrcnull.me>
# Maintainer: Patrycja Rosa <alpine@ptrcnull.me>
pkgname=py3-tokenizers
pkgver=0.15.0
pkgrel=0
pkgdesc="Fast State-of-the-Art Tokenizers optimized for Research and Production"
url="https://github.com/huggingface/tokenizers"
arch="all !s390x !riscv64" # blocked by rust
license="Apache-2.0"
depends="python3"
makedepends="
	bzip2-dev
	cargo
	openssl-dev>3
	py3-gpep517
	py3-maturin
	py3-wheel
	"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/huggingface/tokenizers/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/tokenizers-$pkgver/bindings/python"
options="net !check" # requires pulling test data


build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/tokenizers*.whl
}

sha512sums="
2d355e67059a245613229965f9b0d65f6f149c552a5917ade142f150bc242da1425a025f72bc664dd17793a20fd5a6b880b43bfd3fc7fdc7db52ff9f54d1016c  py3-tokenizers-0.15.0.tar.gz
"
